package com.jereh.topnews.demo;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.jereh.topnews.R;
import com.jereh.topnews.fragment.base.BaseFragment;

/**
 * Created by Administrator on 2016/11/17.
 */
public class DemoFragment extends BaseFragment {

    public int colorId;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view=inflater.inflate(R.layout.fragment_demo_view,null);
        //修改属性值
        isPrepared=true;
        View bg=view.findViewById(R.id.bg);
        bg.setBackgroundColor(getResources().getColor(colorId));
//        Log.e("jereh","fragment开始创建，id==="+getFId());
        onLazyLoad();
        return view;
    }

    @Override
    protected void onLazyLoad() {
        if(isVisible&&isPrepared) {
            //满足可见及准备完成的情况下懒加载数据
        }
    }
}
